package mysql

import "gorm.io/gorm"

type Shop struct {
	gorm.Model
	ShopName   string  `gorm:"type:varchar(20);not null;comment:'商品名称'"`
	ShopStatus string  `gorm:"type:varchar(20);not null;comment:'商品状态'"`
	ShopStock  int64   `gorm:"type:int(11);not null;comment:'商品库存'"`
	ShopPrice  float64 `gorm:"type:decimal(10,2);not null;comment:'商品价格'"`
}

func (s *Shop) Create() error {
	return DB.Create(&s).Error
}
func (s *Shop) Info(ShopId int64) error {
	return DB.Where("id = ?", ShopId).Limit(1).Find(&s).Error
}
